#
# Validates user input
#
# 2009, Mike Widner <mikewidner@gmail.com>
#
######

package Fangcheng::Validator;

use 5.006001;
use strict;
use warnings;
use vars qw( $AUTOLOAD @ISA );

require Fangcheng;

@ISA = qw( Fangcheng );

my $VERSION = '0.01';

# verify the format of a user-defined matrix
sub checkUserMatrix {
#	foreach my $row ( 1 .. $nRows ) {
#			foreach my $col ( 1 .. $nCols ) {
#				if (   ( $col == $row + 1 )
#					or ( $col == $row )
#					or ( $col == 1 and $row == $nRows )
#					or $col == $nCols )
#				{
#					my $input = $query->param("u[$row][$col]");
#					$input =~ s/\s+//g;
#					if ( $input =~ m/^\-?\d+(\/\d+)?$/ ) {
#						$u[$row][$col] = $input;
#					}
#					else {
#						$inputerror .=
#qq{<p>"$input" is not valid input. Entries must be an integer or a proper fraction. };
#						if ( $input =~ m/\-?\d+(\/\d+)?/ ) {
#							$u[$row][$col] = $&;
#						}
#						else {
#							$u[$row][$col] = 0;
#						}
#						$inputerror .=
#						  qq{The entry has been set to $u[$row][$col].</p>};
#					}
#				}
#				else {
#					$u[$row][$col] = 0;
#				}
#				$matrixBook[$matrixNum][ $row - 1 ][ $col - 1 ] = "$u[$row][$col]";
#			}
#		}
}


1;